<template>
  <li class="cjy-page-body-commodity-li">
    <div>
      <div class="cjy-page-bod-commodity-box">
        <div class="cjy-page-image-box" @click="gotoDetail">
          <img v-lazy="comInfor.mainPic" style="width: 100%" class="cjy-page-image-box-img" >
        </div>
        <div class="cjy-page-title-box">

          <span style="width: 100%">{{goodsName || '\r'}} </span>
        </div>
        <div class="cjy-page-lable-box">
          <span class="cjy-lable" v-if="regularTypeLabel"> {{regularTypeLabel}}</span>
          <span v-else>{{'\r'}}</span>
        </div>
        <div style="text-align: left;margin-left: 0.7rem;font-size: 0.5rem;margin-top:0.2rem;color:#6b6b6b">
          <del class="normal-price" v-if="showNormalPrice != showWsPrice" v-show="showNormalPrice!='0.00'">¥{{parseFloat(showNormalPrice).toFixed(2)}}</del>
          <span v-else>{{'\r'}}</span>
          </div>
        <div class="cjy-page-price-box">
          ¥<span class="cjy-price">{{showWsPrice}}</span>
          <span class="cjy-price-unit" v-if="showUnit">/{{showUnit}}</span>
        </div>


        <div>
          <update-cart
            :addCartButtonType="0"
            ref="updateCart"
            :commodityInfor="comInfor"
            :goodsId="goodsId">

            <div slot="button" slot-scope="props"
                 class="cjy-add-cart-button-box"
                 @click="cartButtonOnClick">
              <button-change-cart :type="2" fontSize="1.5rem" :style="buttonStyle">
              </button-change-cart>
            </div>

          </update-cart>
        </div>

        <!--<div v-if="!buttonActive" @click="cartButtonOnClick"-->
        <!--style="bottom:0.4rem;position:absolute;right:0.8rem;">-->
        <!--<div style="float:right;font-size: 0.6rem;font-weight: 600;height: 1.2rem;line-height: 1.2rem">-->
        <!--立击抢购-->
        <!--</div>-->
        <!--</div>-->

      </div>
    </div>
  </li>
</template>

<script>
  import UpdateCart from '@/components/UpdateCart'
  import lazyLoad from 'vue-lazyload'
  import ButtonChangeCart from '@/components/ButtonChangeCart/icon'
  import  minxinAuto from '../mixinAuto.vue'
  export default {
    mixins: [minxinAuto],
    components: {UpdateCart, ButtonChangeCart},
  }
</script>

<style scoped>
  .cjy-page-body-commodity-li {
    position: relative;
    float: left;
    width: 50%;
    margin-bottom: 0.5rem;
  }

  .cjy-page-body-commodity-li > div {
    width: 100%;
    padding: 0 0.35rem;
  }

  .cjy-page-bod-commodity-box {
    width: 100%;
    background: white;
    position: relative;
    border-radius: 5px;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .cjy-page-image-box {
    width: 100%;
    height: 0;
    position: relative;
    padding-bottom: 90%;
    overflow: hidden
  }

  .cjy-page-title-box, .cjy-page-lable-box, .cjy-page-price-box, .cjy-page-lable-box {
    padding: 0 0.7rem;
    text-align: left;
  }

  .cjy-page-title-box {
    height: 1.8rem;
    color: #181818;
    /*font-weight: 600;*/
    font-size: 0.6rem;
    line-height: 0.9rem;
    /*text-overflow: ellipsis;*/
    overflow: hidden;
    word-break: break-all;
    white-space: pre-wrap;
  }

  .cjy-page-subtitle-box {
    color: greenyellow;
    font-weight: 600;
    font-size: 0.6rem;
    line-height: 0.9rem;
    text-overflow: ellipsis;
    overflow: hidden;
    word-break: break-all;
    white-space: normal;
  }

  .cjy-page-lable-box {
    height: 1rem;
  }

  .cjy-page-lable-box > .cjy-lable {
    display: inline-block;
    border-radius: 0.4rem;
    border: 1px solid red;
    font-size: 0.5rem;
    color: red;
    padding: 0px 0.2rem;
  }

  .cjy-page-price-box {
    position: relative;
    bottom: 0;
    width: 100%;
    margin-bottom: 0.4rem;
    font-size: 0.5rem;
    color: rgb(255, 115, 32);
  }

  .cjy-page-price-box > .cjy-price {
    font-size: 0.8rem;
    font-weight: 400;
  }

  .cjy-page-price-box > .cjy-price-unit {
    color: #777777;
  }

  .cjy-add-cart-button-box {
    height: 2rem;
    width: 2rem;
    position: absolute;
    z-index: 1;
    right: 0;
    bottom: 0;
  }
</style>
